package cmu.andersonlab.hardpropagate;

import java.io.*;

public class session_list {
    private static String session_path = "./sessions/";

    public static File[] get_files() {
        File[] sessions;
        File dir = new File(session_path);
        sessions = dir.listFiles(new FilenameFilter() {
                @Override
                public boolean accept (File dir, String name) {
                    return name.endsWith(".txt");
                }
            });
        return sessions;
    }

    public static  String[] get_names() {
        File[] f = get_files();
        String[] n = new String[f.length];
        for (int i=0; i<f.length; i++) {
            n[i] = f[i].getName();
        }
        return n;
    }

    public static String get_session_file (String session) {
        return session_path + session;
    }

    public static boolean exists (String session) {
        File f = new File(session_path + session);
        return f.exists();
    }
}
